Skip to main content

line

Type

keyword

Summary

Designates a return-delimited string as part of a chunk expression. It also designates the paint tool used to draw line shapes and specifies, through the style property, that a graphic is a line.

Syntax

line

Description

Use the line keyword to paint a curved line with the penColor, to draw a line shape, or to refer to a specific line or lines in a container.

When using the Line tool, the cursor is a crosshairs shape (over stack windows) or an arrow (anywhere else). This tool is used to draw a straight line in the penColor.

If you try to paint with the Line tool on a card that has no images, an image the size of the card is created to hold the painting. If the current card already has one or more images, painting outside the image has no effect.

Setting the style of a graphic to "line" makes the graphic into a curved line. Line graphics, unlike painted lines, can be changed and reshaped: use the points property to change the line's angle and position.

note

To avoid script errors, enclose the word "line" in double quotes when you use it to indicate a graphic's style. This prevents LiveCode from getting confused about whether you mean the line style, or the contents of a line in a container.

By default, a line is delimited by return (ASCII 10). However, you can set the lineDelimiter property to any character in order to directly address chunks delimited by that character.

A line is a string of characters delimited by a single return character (or a single one of the lineDelimiter character). A single line can contain multiple characters, multiple words, and multiple items.

note

In LiveCode, if the last character of a string is return, this is ignored by the line keyword. For example the last line of the following string is "Line 3" :

    Line 1
Line 2
Line 3
<empty Line>
note

The line chunk is identical to the paragraph chunk, except that the paragraph chunk is also delimited by the Unicode paragraph separator character.

Examples

get line 3 of the stacks
choose line tool
set the style of graphic "Divider" to "line"

command: choose

function: lineOffset

glossary: chunk, chunk expression, container, delimit, double quote, keyword, LiveCode, paint tool, property, Unicode

keyword: character, characters, graphic, items, line, lines, paragraph, string, trueWord, word, words

object: graphic

property: lineDelimiter, penColor, points, style

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?